//
//  DFType.m
//  微商社区
//
//  Created by nahuo on 15/1/29.
//  Copyright (c) 2015年 nahuo. All rights reserved.
//

#import "DFType.h"

@implementation DFType

- (instancetype)initWithCode:(NSString *)code
{
    if (self = [super init]) {
        self.code = code;
    }
    return self;
}

/** 类型标识符 */
- (void)setCode:(NSString *)code
{
    _code = code;
    if ([code hasPrefix:@"@"] && code.length > 3) {
        NSString* tmp = code;
        // 去掉@"和"，截取中间的类型名称
        tmp = [tmp substringFromIndex:2];
        tmp = [tmp substringToIndex:tmp.length - 1];
        _typeClass = NSClassFromString(tmp);
    }

    
    

}


@end
